<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>前端配置管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
			var csShowValue = '${sfConfig.csShow}';
			isShowImgs(csShowValue);
		});
		
		function isShowImgs(csShowValue){
			if(csShowValue == '2' || csShowValue == '3'){
				$("#div-csShowImgs").show();
			}else{
				$("#div-csShowImgs").hide();
			}
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
<%-- 		<li><a href="${ctx}/config/sfConfig/">前端配置列表</a></li> --%>
		<li class="active"><a href="${ctx}/config/sfConfig/form?id=${sfConfig.id}">前端配置<shiro:hasPermission name="config:sfConfig:edit">${not empty sfConfig.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="config:sfConfig:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="sfConfig" action="${ctx}/config/sfConfig/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">客服中心显示配置：</label>
			<div class="controls">
				<form:radiobuttons path="csShow" items="${fns:getDictList('sf_config_cs_show')}" itemLabel="label" itemValue="value" htmlEscape="false" class="" onclick="isShowImgs(this.value)"/>
			</div>
		</div>
		<div id="div-csShowImgs" class="control-group">
			<label class="control-label">客服中心显示配置图片：</label>
			<div class="controls">
				<form:hidden id="csShowImgs" path="csShowImgs" htmlEscape="false" class="input-xlarge"/>
				<sys:ckfinder input="csShowImgs" type="images" uploadPath="/config/csShowImgs" selectMultiple="true"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">客服中心中英文切换：</label>
			<div class="controls">
				<form:radiobuttons path="csLanguage" items="${fns:getDictList('sf_config_cs_language')}" itemLabel="label" itemValue="value" htmlEscape="false" class=""/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">屏保语音唤醒配置：</label>
			<div class="controls">
				<form:input path="scVoiceWake" htmlEscape="false" maxlength="500" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">屏保地址配置：</label>
			<div class="controls">
				<form:input path="scUrl" htmlEscape="false" maxlength="500" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">服务网点显示地址：</label>
			<div class="controls">
				<form:input path="sShowUrl" htmlEscape="false" maxlength="500" class="input-xlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="config:sfConfig:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
<!-- 			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/> -->
		</div>
	</form:form>
</body>
</html>